<template>
  <div>
    <h1>provide和inject</h1>
    <h2>Count:{{ count }}</h2>
    <button @click="add">add</button>
    <hr />
    <ChildA ></ChildA>
  </div>
</template>
<script setup>
import { ref, provide } from "vue";
import ChildA from "./ChildA.vue";

const count = ref(0);
provide("mycount", count);
const add = () => {
    count.value++;
};
</script>
<style></style>
